/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.myBook.slayer.service.persistence;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.ReferenceRegistry;
import com.liferay.portal.service.ServiceContext;

import com.myBook.slayer.model.MyBook;

import java.util.List;

/**
 * The persistence utility for the my book service. This utility wraps {@link MyBookPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author meenu
 * @see MyBookPersistence
 * @see MyBookPersistenceImpl
 * @generated
 */
public class MyBookUtil {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
	 */

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
	 */
	public static void clearCache() {
		getPersistence().clearCache();
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
	 */
	public static void clearCache(MyBook myBook) {
		getPersistence().clearCache(myBook);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
	 */
	public long countWithDynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return getPersistence().countWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
	 */
	public static List<MyBook> findWithDynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
	 */
	public static List<MyBook> findWithDynamicQuery(DynamicQuery dynamicQuery,
		int start, int end) throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
	 */
	public static List<MyBook> findWithDynamicQuery(DynamicQuery dynamicQuery,
		int start, int end, OrderByComparator orderByComparator)
		throws SystemException {
		return getPersistence()
				   .findWithDynamicQuery(dynamicQuery, start, end,
			orderByComparator);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
	 */
	public static MyBook update(MyBook myBook, boolean merge)
		throws SystemException {
		return getPersistence().update(myBook, merge);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
	 */
	public static MyBook update(MyBook myBook, boolean merge,
		ServiceContext serviceContext) throws SystemException {
		return getPersistence().update(myBook, merge, serviceContext);
	}

	/**
	* Caches the my book in the entity cache if it is enabled.
	*
	* @param myBook the my book
	*/
	public static void cacheResult(com.myBook.slayer.model.MyBook myBook) {
		getPersistence().cacheResult(myBook);
	}

	/**
	* Caches the my books in the entity cache if it is enabled.
	*
	* @param myBooks the my books
	*/
	public static void cacheResult(
		java.util.List<com.myBook.slayer.model.MyBook> myBooks) {
		getPersistence().cacheResult(myBooks);
	}

	/**
	* Creates a new my book with the primary key. Does not add the my book to the database.
	*
	* @param bookId the primary key for the new my book
	* @return the new my book
	*/
	public static com.myBook.slayer.model.MyBook create(long bookId) {
		return getPersistence().create(bookId);
	}

	/**
	* Removes the my book with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param bookId the primary key of the my book
	* @return the my book that was removed
	* @throws com.myBook.slayer.NoSuchMyBookException if a my book with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.myBook.slayer.model.MyBook remove(long bookId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.myBook.slayer.NoSuchMyBookException {
		return getPersistence().remove(bookId);
	}

	public static com.myBook.slayer.model.MyBook updateImpl(
		com.myBook.slayer.model.MyBook myBook, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().updateImpl(myBook, merge);
	}

	/**
	* Returns the my book with the primary key or throws a {@link com.myBook.slayer.NoSuchMyBookException} if it could not be found.
	*
	* @param bookId the primary key of the my book
	* @return the my book
	* @throws com.myBook.slayer.NoSuchMyBookException if a my book with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.myBook.slayer.model.MyBook findByPrimaryKey(long bookId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.myBook.slayer.NoSuchMyBookException {
		return getPersistence().findByPrimaryKey(bookId);
	}

	/**
	* Returns the my book with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param bookId the primary key of the my book
	* @return the my book, or <code>null</code> if a my book with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.myBook.slayer.model.MyBook fetchByPrimaryKey(long bookId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByPrimaryKey(bookId);
	}

	/**
	* Returns all the my books where bookTitle = &#63;.
	*
	* @param bookTitle the book title
	* @return the matching my books
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.myBook.slayer.model.MyBook> findByBookTitle(
		java.lang.String bookTitle)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByBookTitle(bookTitle);
	}

	/**
	* Returns a range of all the my books where bookTitle = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param bookTitle the book title
	* @param start the lower bound of the range of my books
	* @param end the upper bound of the range of my books (not inclusive)
	* @return the range of matching my books
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.myBook.slayer.model.MyBook> findByBookTitle(
		java.lang.String bookTitle, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByBookTitle(bookTitle, start, end);
	}

	/**
	* Returns an ordered range of all the my books where bookTitle = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param bookTitle the book title
	* @param start the lower bound of the range of my books
	* @param end the upper bound of the range of my books (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching my books
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.myBook.slayer.model.MyBook> findByBookTitle(
		java.lang.String bookTitle, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByBookTitle(bookTitle, start, end, orderByComparator);
	}

	/**
	* Returns the first my book in the ordered set where bookTitle = &#63;.
	*
	* @param bookTitle the book title
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching my book
	* @throws com.myBook.slayer.NoSuchMyBookException if a matching my book could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.myBook.slayer.model.MyBook findByBookTitle_First(
		java.lang.String bookTitle,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.myBook.slayer.NoSuchMyBookException {
		return getPersistence()
				   .findByBookTitle_First(bookTitle, orderByComparator);
	}

	/**
	* Returns the first my book in the ordered set where bookTitle = &#63;.
	*
	* @param bookTitle the book title
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching my book, or <code>null</code> if a matching my book could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.myBook.slayer.model.MyBook fetchByBookTitle_First(
		java.lang.String bookTitle,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .fetchByBookTitle_First(bookTitle, orderByComparator);
	}

	/**
	* Returns the last my book in the ordered set where bookTitle = &#63;.
	*
	* @param bookTitle the book title
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching my book
	* @throws com.myBook.slayer.NoSuchMyBookException if a matching my book could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.myBook.slayer.model.MyBook findByBookTitle_Last(
		java.lang.String bookTitle,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.myBook.slayer.NoSuchMyBookException {
		return getPersistence()
				   .findByBookTitle_Last(bookTitle, orderByComparator);
	}

	/**
	* Returns the last my book in the ordered set where bookTitle = &#63;.
	*
	* @param bookTitle the book title
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching my book, or <code>null</code> if a matching my book could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.myBook.slayer.model.MyBook fetchByBookTitle_Last(
		java.lang.String bookTitle,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .fetchByBookTitle_Last(bookTitle, orderByComparator);
	}

	/**
	* Returns the my books before and after the current my book in the ordered set where bookTitle = &#63;.
	*
	* @param bookId the primary key of the current my book
	* @param bookTitle the book title
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next my book
	* @throws com.myBook.slayer.NoSuchMyBookException if a my book with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.myBook.slayer.model.MyBook[] findByBookTitle_PrevAndNext(
		long bookId, java.lang.String bookTitle,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.myBook.slayer.NoSuchMyBookException {
		return getPersistence()
				   .findByBookTitle_PrevAndNext(bookId, bookTitle,
			orderByComparator);
	}

	/**
	* Returns all the my books.
	*
	* @return the my books
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.myBook.slayer.model.MyBook> findAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll();
	}

	/**
	* Returns a range of all the my books.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of my books
	* @param end the upper bound of the range of my books (not inclusive)
	* @return the range of my books
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.myBook.slayer.model.MyBook> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end);
	}

	/**
	* Returns an ordered range of all the my books.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of my books
	* @param end the upper bound of the range of my books (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of my books
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.myBook.slayer.model.MyBook> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end, orderByComparator);
	}

	/**
	* Removes all the my books where bookTitle = &#63; from the database.
	*
	* @param bookTitle the book title
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByBookTitle(java.lang.String bookTitle)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeByBookTitle(bookTitle);
	}

	/**
	* Removes all the my books from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public static void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeAll();
	}

	/**
	* Returns the number of my books where bookTitle = &#63;.
	*
	* @param bookTitle the book title
	* @return the number of matching my books
	* @throws SystemException if a system exception occurred
	*/
	public static int countByBookTitle(java.lang.String bookTitle)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByBookTitle(bookTitle);
	}

	/**
	* Returns the number of my books.
	*
	* @return the number of my books
	* @throws SystemException if a system exception occurred
	*/
	public static int countAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countAll();
	}

	public static MyBookPersistence getPersistence() {
		if (_persistence == null) {
			_persistence = (MyBookPersistence)PortletBeanLocatorUtil.locate(com.myBook.slayer.service.ClpSerializer.getServletContextName(),
					MyBookPersistence.class.getName());

			ReferenceRegistry.registerReference(MyBookUtil.class, "_persistence");
		}

		return _persistence;
	}

	/**
	 * @deprecated
	 */
	public void setPersistence(MyBookPersistence persistence) {
	}

	private static MyBookPersistence _persistence;
}